Key cache entries by Podman hex secret ID, not human-readable name#29
Merged
Key cache entries by Podman hex secret ID, not human-readable name#29
Conversation
Setup populated the encrypted cache with keys like "atuin--POSTGRES_PASSWORD" but the serve lookup path receives the Podman hex secret ID in $SECRET_ID (e.g. "40ba10c50224daba166308fbc"). The cache.get() call in serve never matched, so the cache never served a single hit — every lookup always went to the live provider. This is the same class of bug as the dry-run fix in PR #28: Podman identifies secrets by hex ID internally, not by human-readable name. The cache exists specifically to serve secrets when the upstream provider is down. In its first real-world test (Infisical down during a container restart cascade), it failed silently — every Infisical- backed lookup returned a provider error instead of the cached value. Fix: _register_secrets now returns a {key: hex_id} map from the Podman API's create response. The caller uses hex IDs as cache keys so serve's cache.get(secret_id) finds the right entry.
This was referenced Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Setup populated the encrypted cache with keys like
atuin--POSTGRES_PASSWORDbut the serve lookup path receives the Podman hex secret ID in$SECRET_ID(e.g.40ba10c50224daba166308fbc). Thecache.get()call in serve never matched, so the cache has never served a single hit — every lookup always went to the live provider.Same class of bug as the dry-run fix in PR #28: Podman identifies secrets by hex ID internally, not by human-readable name.
The cache exists specifically to serve secrets when the upstream provider is down. In its first real-world test (Infisical down during a container restart cascade on the test server), it failed silently — every Infisical-backed lookup returned a provider error instead of the cached value.
Fix:
_register_secretsnow returns a{key: hex_id}map from the Podman API's create response. The caller uses hex IDs as cache keys so serve'scache.get(secret_id)finds the right entry.Test plan
pytest tests/test_setup.py— newTestRegisterSecretsIdMapverifies_register_secretsreturns the hex ID from the Podman API response.ruff check/ruff format --check/ty check— clean.psi setup, verifypsi cache status --verifyshows entry count, then restart psi-secrets and confirm cache hits in the journal.